/**
 * @author：anlzou
 * @Date：Created in15:21 2021/3/27
 * @Github：https://github.com/anlzou
 * @Description：
 */
package com.anlzou.demo.controller;

import com.xiaoleilu.hutool.util.StrUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@ResponseBody
public class ControllerAll {
    @RequestMapping("/hi")
    public String sayHi(@RequestParam(required = false, name = "who") String who) {
        // 判断字符串是否为空
        if (StrUtil.isBlank(who)) {
            who = "Bingo";
            return who;
        }
        return StrUtil.format("Hi, {}!", who);
    }
}
